﻿<UserControl x:Class="IsikFx.Project.MainApp.Pages.Home"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="500" d:DesignWidth="500"
             xmlns:att="clr-namespace:IsikFx.Project.MainApp.Pages">
    <Grid>
        <StackPanel>
            <ListView Width="auto" Name="usersList">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <Border CornerRadius="6"
                                BorderBrush="Gray"
                                Background="LightBlue"
                                BorderThickness="2"
                                Opacity="0.7">
                            <Grid Margin="0 0 0 20">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="*"  />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="50"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Image Name="Photo" Grid.Column="0" Source="{Binding PhotoPath}" Visibility="Visible" Height="70" Width="100">
                                </Image>
                                <TextBlock  FontSize="30" Grid.Column="1" Margin="0 0 50 0" Text="{Binding DisplayName}" FontWeight="Bold"  />
                                <TextBlock FontSize="30" Grid.Column="3" Text="{Binding TotalFundAmount }" />
                            </Grid>
                        </Border>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </StackPanel>
        <StackPanel  Width="1" Height="1" Background="LightBlue"  Name="Panel">
            <StackPanel.Triggers>
                <EventTrigger RoutedEvent="att:Home.NewFundEvent">
                    <BeginStoryboard>
                        <Storyboard Name="story">
                            <DoubleAnimation Storyboard.TargetName="Panel" 
                       Storyboard.TargetProperty="Width" From="1" To="1500" 
                       Duration="0:0:1" BeginTime="0:0:0"/>
                            <DoubleAnimation Storyboard.TargetName="Panel" 
                       Storyboard.TargetProperty="Opacity" From="0" To="1" 
                       Duration="0:0:0.1" BeginTime="0:0:0"/>
                            <DoubleAnimation Storyboard.TargetName="Panel" 
                       Storyboard.TargetProperty="Height" From="1" To="1000" 
                       Duration="0:0:1" BeginTime="0:0:1"/>
                            <ColorAnimation Storyboard.TargetName="Panel" Storyboard.TargetProperty="(StackPanel.Background).(SolidColorBrush.Color)"
                               From="LightBlue"  To="Green" Duration="0:0:0.2" BeginTime="0:0:2"/>
                            <ColorAnimation Storyboard.TargetName="Panel" Storyboard.TargetProperty="(StackPanel.Background).(SolidColorBrush.Color)"
                               From="Green"  To="LightBlue" Duration="0:0:0.2" BeginTime="0:0:2.2"/>
                            <ColorAnimation Storyboard.TargetName="Panel" Storyboard.TargetProperty="(StackPanel.Background).(SolidColorBrush.Color)"
                               From="LightBlue"  To="Green" Duration="0:0:0.2" BeginTime="0:0:2.4"/>
                            <ColorAnimation Storyboard.TargetName="Panel" Storyboard.TargetProperty="(StackPanel.Background).(SolidColorBrush.Color)"
                               From="Green"  To="LightBlue" Duration="0:0:0.2" BeginTime="0:0:2.6"/>
                            <ColorAnimation Storyboard.TargetName="Panel" Storyboard.TargetProperty="(StackPanel.Background).(SolidColorBrush.Color)"
                               From="LightBlue"  To="Green" Duration="0:0:0.2" BeginTime="0:0:2.8"/>
                            <ColorAnimation Storyboard.TargetName="Panel" Storyboard.TargetProperty="(StackPanel.Background).(SolidColorBrush.Color)"
                               From="Green"  To="LightBlue" Duration="0:0:0.2" BeginTime="0:0:3"/>
                            <DoubleAnimation Storyboard.TargetName="Panel" 
                       Storyboard.TargetProperty="Height" From="1000" 
                       To="1" Duration="0:0:1" BeginTime="0:0:4"/>
                            <DoubleAnimation Storyboard.TargetName="Panel" 
                       Storyboard.TargetProperty="Width" From="1500" To="1" 
                       Duration="0:0:1" BeginTime="0:0:5"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </StackPanel.Triggers>
            <TextBlock Grid.Row="0">
                        <Run Text="{Binding UserName}"></Run>
                        <Run Text=" "></Run>
                        <Run Text="{Binding UserSurname}"></Run>
            </TextBlock>
            <TextBlock Grid.Row="1">
                        <Run Text="{Binding FundAmount}"></Run>
                        <Run Text=" "></Run>
                        <Run Text="{Binding Currency}"></Run>
            </TextBlock>
        </StackPanel>
    </Grid>
    <UserControl.Resources>
        <Style TargetType="TextBlock">
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="FontFamily" Value="Comic Sans MS"/>
            <Setter Property="FontSize" Value="20"/>
        </Style>
    </UserControl.Resources>
</UserControl>
